<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>无缝滚动</title>
    <style>
    *{
        margin: 0;
        padding: 0;
        list-style: none;
    }
    #footer{
        width:1366px;
        height: 70px;
        position: relative;
        overflow: hidden; 
        margin-top:150px; 
    }
   #footer ul{
        width: calc(2220*2px);
        height: 100%;
        position: absolute;
    }
   #footer li{
        float: left;
    }
    </style>
    
</head>
<body>
    <div id="footer">
        <ul>
            <li> <img src="images/footer_bg.png" alt=""></li>
            <li> <img src="images/footer_bg.png" alt=""></li>
        </ul>
    </div>
    <script>
    (function(){
        var oul=document.querySelector("#footer ul");
        var left=oul.offsetLeft;
        var width=oul.offsetWidth;
        var speed=2;
        auto();
        function auto(){
            left=left-speed;
            console.log(left);
            if(left<=-width/2){
                left=0;
            }
            oul.style.left=left+"px";
            requestAnimationFrame(auto);
        }
    })()
    </script>
</body>
</html>